<?php
/**
 * 业务层父类
 * Created by PhpStorm.
 * User: Administrator
 * Date: 15-3-9
 * Time: 下午3:16
 */
namespace impls;
use impls\log\LogImpl;

class BaseImpl {
    protected $log = null;

    /**
     * 抛出异常
     * @param $msg
     * @param string $code
     */
    protected function throwException($msg, $code = '9999') {
        throw new \Exception($msg, $code);
    }

    /**
     * 日志
     * @param $title
     * @param string $content
     */
    protected function log($title, $content = '') {
//        LogImpl::getlogger()->log($title, $content);
    }

    /**
     * 生成订单号
     * @param $prefix
     */
    public function createOrderNo($prefix) {
        return $prefix . date('YmdHis') . rand(10000, 99999);
    }
}